package namespace

import (
	"kms-backend/controllers/namespace"

	"github.com/gin-gonic/gin"
)

// 新增
func create(namespaceGroup *gin.RouterGroup) {
	namespaceGroup.POST("/create", namespace.Create)
}

// 更新
func update(namespaceGroup *gin.RouterGroup) {
	namespaceGroup.POST("/update", namespace.Update)
}

func detail(namespaceGroup *gin.RouterGroup) {
	namespaceGroup.GET("/detail", namespace.Detail)
}

func list(namespaceGroup *gin.RouterGroup) {
	namespaceGroup.GET("/list", namespace.List)
}

func delete(namespaceGroup *gin.RouterGroup) {
	namespaceGroup.GET("/delete", namespace.Delete)
}

func RegisterSubRouter(g *gin.RouterGroup) {
	// 配置路由策略
	namespaceGroup := g.Group("/namespace")
	create(namespaceGroup)
	update(namespaceGroup)
	detail(namespaceGroup)
	list(namespaceGroup)
	delete(namespaceGroup)

}
